package com.kh.first.service;

import com.kh.first.dao.DepartmentDao;
import com.kh.first.pojo.DepartmentPojo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class DepartmentService {

    @Autowired
    private DepartmentDao departmentDao;


    public Long saveDepartment(DepartmentPojo pojo){
        return departmentDao.saveDepartment(pojo);
    }

    public Long saveDepartmentList(List<DepartmentPojo> list){
        return departmentDao.saveDepartmentList(list);
    }

    public Long deleteDepartmentById(Long id){
        return departmentDao.deleteDepartmentById(id);
    }

    public Long updateDepartmentById(DepartmentPojo pojo){
        return departmentDao.updateDepartmentById(pojo);
    }

    public List<DepartmentPojo> getDepartmentList(DepartmentPojo pojo){
        return departmentDao.getDepartmentList(pojo);
    }
    public Long countDepartmentList(DepartmentPojo pojo){
        return departmentDao.countDepartmentList(pojo);
    }
}
